/*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ (function(a,b){if(typeof exports==="object"&&exports){b(exports)}else{var c={};b(c);if(typeof define==="function"&&define.amd){define(c)}else{a.Mustache=c}}}(this,function(a){var e=/\s*/;var l=/\s+/;var j=/\S/;var h=/\s*=/;var n=/\s*\}/;var t=/#|\^|\/|>|\{|&|=|!/;var f=RegExp.prototype.test;function s(z,y){return f.call(z,y)}function g(y){return !s(j,y)}var v=Object.prototype.toString;var k=Array.isArray||function(y){return v.call(y)==="[object Array]"};function d(y){return y.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function m(y){return String(y).replace(/[&<>"'\/]/g,function(z){return c[z]})}function u(y){this.string=y;this.tail=y;this.pos=0}u.prototype.eos=function(){return this.tail===""};u.prototype.scan=function(z){var y=this.tail.match(z);if(y&&y.index===0){this.tail=this.tail.substring(y[0].length);this.pos+=y[0].length;return y[0]}return""};u.prototype.scanUntil=function(z){var y,A=this.tail.search(z);switch(A){case -1:y=this.tail;this.pos+=this.tail.length;this.tail="";break;case 0:y="";break;default:y=this.tail.substring(0,A);this.tail=this.tail.substring(A);this.pos+=A}return y};function r(y,z){this.view=y||{};this.parent=z;this._cache={}}r.make=function(y){return(y instanceof r)?y:new r(y)};r.prototype.push=function(y){return new r(y,this)};r.prototype.lookup=function(y){var B=this._cache[y];if(!B){if(y=="."){B=this.view}else{var A=this;while(A){if(y.indexOf(".")>0){B=A.view;var C=y.split("."),z=0;while(B&&z":H=z.getPartial(G);if(typeof H==="function"){C+=H(y)}break;case"&":H=y.lookup(G);if(H!=null){C+=H}break;case"name":H=y.lookup(G);if(H!=null){C+=a.escape(H)}break;case"text":C+=G;break}}return C}function x(E){var z=[];var D=z;var F=[];var B;for(var A=0,y=E.length;A0?F[F.length-1][4]:z;break;default:D.push(B)}}return z}function b(D){var A=[];var C,z;for(var B=0,y=D.length;B
';return'
'},getRowTemplate:function(){return''},insertDisplayChild:function(e,i){var g={};if(e.model){g={name:e.model.name,label:(e.model.label)?e.model.label:e.model.name};var h=jQuery(Mustache.to_html(this.getRowTemplate(),g))[0];jQuery(".bp-pref-td-input",h).append(e.htmlNode)}else{var h=e.htmlNode}var f=b$._private.htmlAPI.findCaptureClass("portalManagerPreferenceFieldView",this.htmlNode)[0];f.appendChild(h)},createDisplay:function(e){if(e){}else{e=$(Mustache.to_html(this.getTemplate(),this.model.getJSON()))[0]}this.htmlNode=e;this.htmlNode.viewController=this;this.htmlBody=b$._private.htmlAPI.findCaptureClass("bp-pref-table",e)[0];return e},handlePrefModified:function(e){switch(e.attrChange){case 1:break;case 2:break;case 3:break}},connectToModel:function(){this.model.addEventListener("*",function(e){console.log("model "+e.type)});this.model.addEventListener("PrefModified",this.handlePrefModified)},disconnectFromModel:function(){this.model.removeEventListener("PrefModified",this.handlePrefModified)},reset:function(){console.log("reset")},buildFieldsFromPreferences:function(k,h){var j=b$.portal.controllers.preferences;this.map={};this.itemModel=h;for(var g=0,e=k.length;g"},buildHTML:function(){var e=jQuery(this.doTemplate(this.buildJSON()))[0];return e},getBoolAttribute:function(f){var e=this.getAttribute(f);if(e&&e!="false"){return true}return false},setBoolAttribute:function(f,e){if(e){this.setAttribute(f,f)}else{this.removeAttribute(f)}},domActivate:function(){var e=new this.ownerDocument.createEvent("UIEvent");e.initUIEvent("DOMActivate",true,true,window,null);this.dispatchEvent(e)}});var a=b.extend(null,{localName:"FormControl",getForm:function(){var e=this.htmlNode;while(e){if(e.localName=="form"||e.nodeName.toLowerCase()=="form"){return e}e=e.parentNode}}});this.UserPreferenceField=b$.Class;this.UserPreferencesForm=b$.Class});b$.module("b$.portal._private.include",function(){var p=b$.Class;var m=b$._private.ArrayMap;var b=b$._private.ArrayCollection;var f=b$.bdom.events.EventTarget;var q=b$._private.types.TypeConstraintFn;var c=b$._private.types.TypeConstraintNull;var d=b$._private.types.TypeConstraintOptional;var i=b$._private.ArrayIterator;var h=b$._private.uri.URI;var j=b$._private.template.StringTemplate;var a=b$._private.htmlAPI;var n=/^__(WIDGET|GADGET)__/;var s=new q(function(t){return/^proxy|target$/.test(t)});var e=new d(s);var r=new q(function(t){return/^GET|POST$/.test(t)});var g=p.extend(function(v,w,u,t){this.name=new j(v);this.value=new j(w);this.destination=u;this.method=t},{toQueryString:function(u){var t=encodeURIComponent(this.getName(u));return this.getValues(u).map(function(z){if(n.test(z)){var y=z.split("."),w=u;for(var x=1,v=y.length;x"+x.text+"",t.widget.htmlNode.ownerDocument);var y=[];for(var w=0;w]+>/gi,"");A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(B)}else{A=new DOMParser().parseFromString(B,"application/xml")}y.definition=A;y.loaded=true;y.initializeDefinition();y.getResourcesFromDefinition(function(){for(var D=0;D"+b.getContents(z).map(function(G){return(G.xml||C.serializeToString(G)).replace(/<([\w:]+)([^>]*)\/>/gi,"<$1$2>")}).join("")+"");return x.lastChild}},{CSS_IMPORT_REGEXP:/@import\s+(?:'((?:[^\\']|\\.)*)'|"((?:[^\\"]|\\.)*)")/gm,CSS_URL_REGEXP:/url\(\s*(?:'((?:[^\\']|\\.)*)'|"((?:[^\\"]|\\.)*)"|((?:[^\\\)]|\\.)*))\s*\)/gm,CSS_ESCAPE_REGEXP:/\\([^\n\r\f0-9a-fA-F])|\\([0-9a-fA-F]{1,6})(?:\r\n|[ \n\r\t\f])?/g,unescapeCSSLiteral:function(x){return x.replace(g.CSS_ESCAPE_REGEXP,function(z,y,A){return y||String.fromCharCode(parseInt(A,16))})},resolveUrlsInCSS:function(y,x){return y.replace(g.CSS_URL_REGEXP,function(B,z,C,A){return"url('"+k.resolve(g.unescapeCSSLiteral(z||C||A),x).replace(/'/g,"\\'")+"')"}).replace(g.CSS_IMPORT_REGEXP,function(A,z,B){return"@import '"+k.resolve(g.unescapeCSSLiteral(z||B),x).replace(/'/g,"\\'")+"'"})}});function j(B){var x=[];var z=B.attributes;if(window.ActiveXObject&&!window.Performance){for(var A=0,y=z.length;A=0;J--){L.setAttribute(K[J].name,K[J].value)}L.type=E;L.href=k.resolve(I,B);var F=document.createAttribute("rel");F.nodeValue="stylesheet";L.setAttributeNode(F);var G=document.getElementsByTagName("head")[0];G.appendChild(L)}});x.filter(t(d,"script")).forEach(function(I){var E=I.getAttribute("src"),K=I.textContent||I.text,F=I.getAttribute("type")||"text/javascript";var L=j(I);if(E&&!/standalone\.js$/.test(E)){E=E.replace("$(contextRoot)",b$.portal.portalModel.serverURL);var M=document.createElement("script");M.type=F;for(var J=b$._private.resourceManager.resources.length-1;J>=0;J--){if(b$._private.resourceManager.resources[J].uri==k.resolve(E,B)){return}else{var G=new e();G.addURI(F,k.resolve(E,B),null,L)}}c(k.resolve(E,B),function(P){M.text=P.responseText;var O=document.getElementsByTagName("head")[0];O.appendChild(M)})}else{if(!E&&K){var N=document.createElement("script");N.type=F;N.text=K;var H=document.getElementsByTagName("head")[0];H.appendChild(N)}}});x.filter(t(d,"style")).forEach(function(J){var G=J.textContent||J.text,F=J.getAttribute("type")||"text/css";var E=j(J);if(G){var I=document.createElement("style");I.type=F;if(I.styleSheet){I.styleSheet.cssText=G}else{I.appendChild(document.createTextNode(G))}var H=document.getElementsByTagName("head")[0];H.appendChild(I)}});if(D){D()}};this.getResourcesFromConfig=function(x,A){var z=x.replace("$(contextRoot)",b$.portal.portalModel.serverURL);var y=new XMLHttpRequest();y.onreadystatechange=function(){if(this.readyState==4){var E=(this.status+"").charAt(0);if(E=="0"||E=="2"||E=="3"){var D=this.responseText,B;if(window.ActiveXObject&&window.Performance){B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";B.loadXML(D)}else{B=new DOMParser().parseFromString(D,"application/xml")}b$.portal._private.definition.getResourcesFromDefinitionSynchronous(B,z,A)}else{var C={readyState:this.readyState,responseText:this.responseText,status:this.status,statusText:this.statusText};console.log(C)}}};y.open("GET",encodeURI(z),false);y.setRequestHeader("Content-Type","application/xml");y.send(null)}});b$.module("b$.portal.view.bdom.default",function(){var e=function(){return this}();var f=b$.bdom.Namespace;var o=b$.view.bdom.Component;var s=b$.view.perspective.Perspective;var p=b$.view.perspective.PerspectiveType;var j=b$.view.perspective.PerspectiveParameters;var m=b$._private.template.SimpleURITemplate;var c=b$._private.htmlAPI;var u=b$._private.xml;var i=f.extend(function(w){f.call(this,w)},{});var r=new i("http://backbase.com/2012/portalView");this.NS=r;var q=function(x,A,z,w){var y=this;b$.portal.portalServer.loadItemHTML(x.originalItem,function(F,E){var D=F.substring(0,F.indexOf(""))+"";var B=F.substring(F.indexOf("")+6,F.indexOf('